/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx.mapper;

import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>Project: mp2022 - DbMapper
 * <p>Powered by webrx On 2022-04-16 15:03:00
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */
@Service
public interface DbMapper {

    public List<String> tbs();

    public List<String> tbs(String db);

    //@Select("show databases")
    public List<String> dbs();

    @Select("select version()")
    public String version();

    @Select("select user,host,authentication_string,plugin from mysql.user")
    public List<Map<String, Object>> userInfo();

    @Select("select database(),user(),version(),@@datadir,@@basedir")
    public Map<String, Object> dbInfo();

    @Select("show create table ${tb}")
    public Map<String, Object> showCreateTable(String tb);
}


